<template>
  <div id="viewEqu">
    <h1>装备详情<span>（注意：车辆需要定期保养）</span></h1>
    <el-form
      :inline="true"
      style="width: 1140px"
      :model="from"
      label-position="left"
      class="demo-form-inline"
    >
      <el-form-item label="装备信息:" style="width: 200px">
        <span style="color: #67c23a">{{from.id}}</span>
      </el-form-item>
      <el-form-item label="装备名称:" style="width: 200px">
        <span style="color: #67c23a">{{from.equipName}}</span>
      </el-form-item>
      <el-form-item label="分类:" style="width: 200px">
        <span style="color: #67c23a">{{from.equipmentClassName}}</span>
      </el-form-item>
      <el-form-item label="装备状态:" style="width: 200px">
        <span style="color: #67c23a">{{from.state | stateFn}}</span>
      </el-form-item>
      <el-form-item label="价格:" style="width: 200px">
        <span style="color: #67c23a">{{from.price}}</span>
      </el-form-item>
      <el-form-item label="筹措方式:" style="width: 200px">
        <span style="color: #67c23a">{{from.modalities==0?'分配':'自购'}}</span>
      </el-form-item>
      <el-form-item label="使用单位:" style="width: 200px">
        <span style="color: #67c23a">{{from.useunitName}}</span>
      </el-form-item>
      <el-form-item label="存放位置:" style="width: 200px">
        <span style="color: #67c23a">{{from.storageLocationName}}</span>
      </el-form-item>
      <el-form-item label="责任人:" style="width: 200px">
        <span style="color: #67c23a">{{from.responsiblePerson}}</span>
      </el-form-item>
    </el-form>
    <el-menu
      default-active="/home/ZbglSee/Qcqd"
      class="el-menu-demo"
      mode="horizontal"
      :router="true"
    >
      <el-menu-item index="/home/ZbglSee/Qcqd"><el-button type="primary" plain size="medium">器材清单</el-button></el-menu-item>
      <el-menu-item index="/home/ZbglSee/Wxjl"><el-button type="primary" plain size="medium">维修记录</el-button></el-menu-item>
      <el-menu-item index="/home/ZbglSee/Jszl"><el-button type="primary" plain size="medium">技术资料</el-button></el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      from: {
        id:null,
        equipName:'',
        equipmentClassName: '',
        state:null,
        price:'',
        modalities: null,
        useunitName:'',
        storageLocationName:'',
        responsiblePerson:'',
      },
    };
  },
  filters: {
    stateFn: function (n) {
      switch (n) {
        case 0:
          return "正常";
          break;
        case 1:
          return "维修中";
          break;
        case 2:
          return "停用";
          break;
      }
    },
  },
  methods: {
    
  },
  mounted:function(){
    if(this.$store.state.yqy.equManSee){
      this.from.id=this.$store.state.yqy.equManSee.id
      this.from.equipName=this.$store.state.yqy.equManSee.equipmentName.equipName
      this.from.equipmentClassName=this.$store.state.yqy.equManSee.equipmentClass.equipmentClassName
      this.from.state=this.$store.state.yqy.equManSee.state
      this.from.price=this.$store.state.yqy.equManSee.price
      this.from.modalities=this.$store.state.yqy.equManSee.modalities
      this.from.useunitName=this.$store.state.yqy.equManSee.useunits.useunitName
      this.from.storageLocationName=this.$store.state.yqy.equManSee.storageLocation.storageLocationName
      this.from.responsiblePerson=this.$store.state.yqy.equManSee.responsiblePerson
    }
  },
};
</script>

<style scoped lang="less">
#viewEqu {
  padding: 30px 30px 30px 30px;
  h1 {
    margin-bottom: 20px;
    span {
      font-size: 10px;
      font-weight: lighter;
      color: rgba(0, 0, 0, 0.5);
    }
  }
  &.div {
    margin: 20px 0;
  }
}
</style>